package com.xuebang.admin.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;

import com.xuebang.admin.entity.OperGroupRule;

public interface OperGroupRuleMapper extends BaseMapper<OperGroupRule> {

	@Select("select * from oper_group_rule")
	List<OperGroupRule> search();

	@Delete("delete from oper_group_rule where GROUP_ID = #{groupId} ")
	void deleteOperGroupRuleByGroupId(Long groupId);

	@InsertProvider(type = SQLProvider.class, method = "insert")
	@SelectKey(statement = "select last_insert_id()", keyProperty = "groupRuleId", before = false, resultType = Long.class)
	void insertOperGroupRule(OperGroupRule operGroupRule);

}
